using System;
using System.Collections.Generic;
using UnityEngine;

namespace Main.Audio
{
    [CreateAssetMenu(fileName = "SceneSoundList_SO", menuName = "ScriptableObject/SceneSoundList_SO", order = 0)]
    public class SceneSoundList_SO : ZSWF_SOSingleton<SoundDetailsList_SO>
    {
        public List<SceneSoundItem> SceneSoundDetailsList;

        public bool TryGetSceneSoundDetails(string sceneName, out SceneSoundItem sceneSoundDetails)
        {
            foreach (var item in SceneSoundDetailsList)
            {
                if (item.sceneName == sceneName)
                {
                    sceneSoundDetails = item;
                    return true;
                }
            }
            sceneSoundDetails = null;
            return false;
        }

    }

    [Serializable]
    public class SceneSoundItem
    {
        [SceneName] public string sceneName;
        public SoundName ambient;
        public SoundName music;
    }
}